package com.crbim.modules.config;

import org.apache.coyote.Request;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AsyncAspect {
//    // @Async开启异步处理
//    @Async
//    @Before("execution(* com.crbim.modules.cutsurface.service.*(..))")
//    public void beforeMethod(JoinPoint joinPoint) {
//        // 获取传递给方法的参数
//        Object[] args = joinPoint.getArgs();
//        // 处理参数  HttpServletRequest   获取crbimid
//        for (Object arg : args) {
//            System.out.println("参数值: " + arg);
//        }
//        //处理完成参数后执行http请求，请求三方传递 crbimid  和其他信息
//    }
//    @Async
//    @Before("execution(* com.crbim.modules.cutsurface.controller.*(..))")
//    public void beforeController(JoinPoint joinPoint) {
//        Object[] args = joinPoint.getArgs();
//        for (Object arg : args) {
//            System.out.println("参数值: " + arg);
//        }
//    }
}
